import {getPath} from './util'

const RouterUniversity = [

  {
    path: getPath('/university'),
    name: 'university1',
    component: resolve => require([`@/pages/tabs/university/university`], resolve),
  },
  {
    path: '/university',
    name: 'university',
    component: resolve => require([`@/pages/tabs/university/university`], resolve),
    children: [
      {
        path: getPath('chart'),
        name: 'chart',
        component: resolve => require([`@/pages/university/chart/chart`], resolve),
        meta: {
          title: '数据'
        }
      },
      {
        path: getPath('ranking'),
        name: 'ranking',
        component: resolve => require([`@/pages/university/ranking/ranking`], resolve),
        meta: {
          title: '排行榜'
        }
      },
      {
        path: getPath('team'),
        name: 'team',
        component: resolve => require([`@/pages/university/team/team`], resolve),
        meta: {
          title: '成员管理'
        }
      },

    ],
  },

  {
    path: getPath('/university/total'),
    name: 'university-total2',
    component: resolve => require([`@/pages/university/total/university-total`], resolve),
  },
  {
    path: '/university/total',
    name: 'university-total',
    component: resolve => require([`@/pages/university/total/university-total`], resolve),
    children: [
      {
        path: getPath('chart'),
        name: 'chart',
        component: resolve => require([`@/pages/university/chart/chart-total`], resolve),
        meta: {
          title: '汇总统计'
        }
      },
      {
        path: getPath('ranking'),
        name: 'ranking',
        component: resolve => require([`@/pages/university/ranking/ranking-total`], resolve),
        meta: {
          title: '汇总统计'
        }
      },
      {
        path: getPath('team'),
        name: 'team',
        component: resolve => require([`@/pages/university/team/team-total`], resolve),
        meta: {
          title: '汇总统计'
        }
      },

    ],
  },
  {
    path: '/university/userIndex',
    name: 'userIndex',
    component: resolve => require([`@/pages/university/team/userpage/user-index`], resolve),
    children: [
      {
        path: getPath('history/:userId'),
        name: 'history',
        component: resolve => require([`@/pages/university/team/userpage/user-history`], resolve),
        meta: {
          title: '历史'
        }
      },
      {
        path: getPath('cert/:userId'),
        name: 'cert',
        component: resolve => require([`@/pages/university/team/userpage/user-cert`], resolve),
        meta: {
          title: '证书'
        }
      },

    ],
  },
  {
    path: getPath('/university/team/invite/:teamId'),
    name: 'invite',
    component: resolve => require([`@/pages/university/team/invite/invite`], resolve),
    meta: {
      requireAuth: true,
      title: '邀请成员加入'
    }
  },
  {
    path: getPath('/university/team/invite-enterprise/:teamId'),
    name: 'invite',
    component: resolve => require([`@/pages/university/team/invite/invite-enterprise`], resolve),
    meta: {
      requireAuth: true,
      title: '企业加盟'
    }
  },
  {
    path: getPath('/university/team/invite-share/:teamId/:rec/:userId'),
    name: 'inviteShare',
    component: resolve => require([`@/pages/university/team/invite/invite-share`], resolve),
    meta: {
      requireAuth: true,
      ignoreEnterprise: true,
      title: '加入团队'
    }
  },
];

export default RouterUniversity
